//
//  WKExportKeyView.m
//  ourToken
//
//  Created by wakeup on 2018/6/4.
//  Copyright © 2018年 ourtoken. All rights reserved.
//

#import "WKExportKeyView.h"
#import "WKBaseHeader.h"

@interface WKExportKeyView ()

@property (weak, nonatomic) IBOutlet UIView *backView;//view的背景
@property (weak, nonatomic) IBOutlet UIView *wordsBackkView;//助记词背景view
@property (weak, nonatomic) IBOutlet UILabel *words;//助记词

@end

@implementation WKExportKeyView

- (void)awakeFromNib {
    [super awakeFromNib];
    self.backView.layer.cornerRadius = 10;
    self.backView.layer.masksToBounds = YES;
    
    self.wordsBackkView.layer.cornerRadius = 5;
    self.wordsBackkView.layer.masksToBounds = YES;
    
    self.sureCopyBtn.backgroundColor = AppManager.themeColor;
    self.sureCopyBtn.titleLabel.font = AppManager.btnFont;
    self.sureCopyBtn.layer.cornerRadius = 5;
    self.sureCopyBtn.layer.masksToBounds = YES;
}

- (IBAction)clickCopyBtn:(id)sender {
    if (self.sureBlock) {
        self.sureBlock(self.words.text);
    }
    UIPasteboard*pasteboard = [UIPasteboard generalPasteboard];
    
    pasteboard.string=self.words.text;
    [self removeFromSuperview];
}

- (IBAction)clickCancelBtn:(id)sender {
    if (self.cancelBlock) {
        self.cancelBlock();
    }
    [self removeFromSuperview];

//    [UIView animateWithDuration:0.5 animations:^{
//        self.frame = CGRectMake(0, AppManager.height, AppManager.width, AppManager.height);
//    } completion:^(BOOL finished) {
//        self.superview.userInteractionEnabled = YES;
//        [self removeFromSuperview];
//    }];
}


@end
